package controller.view;

import java.util.HashSet;
import java.util.Set;

import command.Command;

import model.Statechart;
import model.StatechartComponent;

import view.interfaces.statechart.StatechartView;

public class StatechartController {
	private final Statechart statechart;
	private final WorkspaceController workspaceController;
	private final StatechartView statechartView;
	private Set<StatechartComponent> selectedComponents = new HashSet<StatechartComponent>();

	public StatechartController(final Statechart statechart,
			final WorkspaceController workspaceController,
			final StatechartView statechartView) {
		this.statechart = statechart;
		this.workspaceController = workspaceController;
		this.statechartView = statechartView;
	}

	public Set<StatechartComponent> getSelectedComponents() {
		return selectedComponents;
	}

	public void setSelectedComponents(
			Set<StatechartComponent> selectedComponents) {
		this.selectedComponents = selectedComponents;
	}

	public void clearSelectedComponents() {
		this.selectedComponents.clear();
	}

	public void executeCommand(Command command) {
		workspaceController.executeCommand(command, statechart);
	}

}
